package com.minelx.table.core.series.source;

import java.util.stream.Stream;

public class GridRowSource<E> implements Source<E> {

	private final GridSource<E> gridSource;

	private final long rowAt;

	public GridRowSource(GridSource<E> gridSource, long rowAt) {
		this.gridSource = gridSource;
		this.rowAt = rowAt;
	}

	@Override
	public E at(long at) {
		return gridSource.at(rowAt, at);
	}

	@Override
	public Stream<E> stream() {
		return gridSource.rowValues(rowAt);
	}

	@Override
	public long len() {
		return gridSource.availableColumn();
	}
}
